<?php
/*This is ajax file for saving result in draft*/
require_once "includes/config.php";
$draft_id = $_REQUEST['draft_id'];
$sql=mysql_query("select * from tbl_drafts where draft_id='".$draft_id."' limit 1") or die(mysql_error());
$cnt_sql = mysql_num_rows($sql);
if($cnt_sql==0)
{
    echo '0';
}
else {
    $row = mysql_fetch_array($sql);    
    
    
    
    $category_id                = $row['category_id'];
    
    $qry = mysql_query("select parent_id from tbl_category where category_id=$category_id") or die(mysql_error());
    $category   =   mysql_fetch_array($qry);
    $parent_id  =   $category['parent_id'];
    
    
    $pro_name                   = $row['product_name'];
    $pro_description            = $row['product_description'];
    $pro_price                  = $row['product_price'];
    $bargain_price_option       = $row['bargain_price_option'];
    $pro_courior                = $row['courior_id'];
    $pro_ship                   = $row['shipping'];
    $ship_status                = $row['ship_status'];
    $localPickup                = $row['localPickup'];
    $pro_commission             = $row['commission'];
    $bargain_commission_option  = $row['bargain_commission_option'];
    $pro_quantity               = $row['quantity'];
    $pro_condition              = $row['pro_condition'];
    $sales_tax                  = $row['sales_tax'];
    $pro_policy                 = $row['return_id'];
    $remarks                    = $row['remarks'];
    $amazon_name                = $row['amazon_name'];
    $gift_name                  = $row['gift_name'];
    $gift_description           = $row['gift_description'];
    
    echo  $category_id."###".$pro_name."###".$pro_description."###".$pro_price."###".$bargain_price_option."###".$pro_courior."###".$pro_ship."###".$ship_status."###".$localPickup."###".$pro_commission."###".$bargain_commission_option."###".$pro_quantity."###".$pro_condition."###".$sales_tax."###".$pro_policy."###".$remarks."###".$amazon_name."###".$gift_name."###".$gift_description."###".$parent_id;
}



?>